package thread;

import org.w3c.dom.ls.LSOutput;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入倒计时的秒数");
        for(int i=scan.nextInt();i>=0;i--){
            System.out.println(i);
              try{
              Thread.sleep(1000);
          }catch(InterruptedException e){
              e.printStackTrace();
        }
        }
        System.out.println("倒计时结束");
//        System.out.println("程序开始了");
//        long start=System.currentTimeMillis();
//        try{
//            Thread.sleep(5000);
//        }catch(InterruptedException e){
//            e.printStackTrace();
//        }
//        long end=System.currentTimeMillis();
//
//        System.out.println("程序结束了");
//        System.out.println("long");
    }
}
